<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="../1.6.9/angular.min.js"></script>
</head>
<body>
<div ng-app="hd" ng-controller="ctrl">
    <input type="text" name="title" ng-model="name">
    {{name}}
    <button ng-click="red()">双向绑定</button>
</div>
<script>
    var m = angular.module('hd', []);
    m.controller('ctrl', ['$scope', function ($scope) {
        $scope.name = '后盾网';
        $scope.red = function () {
            alert($scope.name);
        };
    }]);
</script>
</body>
</html>